using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using T2.WebSecurity.ASPMVC.Entity.Search;
using T2.WebSecurity.ASPMVC.Entity.Search.Interface;
using T2.WebSecurity.Business.Entities.Search.Interfaces;
using T2.WebSecurity.Business.Entities.Search;


//--Change Management Control - Membership ASPMVC Entity Translator  --**********************
//--Created By: James Rooks
//--Description: Membership Translator
//--Created Date: 02/05/2013 18:24:15
//--*************************************************************
namespace T2.WebSecurity.ASPMVC.Entity.Translators.Search
{
	public partial class MembershipUISearchTranslator 
	{
		public IMembershipSearch_biz TranslateToBusinessLayer(IMembershipSearch_ui _translateFrom)
        {
            IMembershipSearch_biz temp = new MembershipSearch_biz();
		
			if(_translateFrom != null)
			{
			
			temp.ConfirmationToken = _translateFrom.ConfirmationToken;
			if(_translateFrom.Beg_LastPasswordFailureDate != null)
			{
				temp.Beg_LastPasswordFailureDate = _translateFrom.Beg_LastPasswordFailureDate;
			}
			else
				{
					temp.Beg_LastPasswordFailureDate = Convert.ToDateTime("01/01/1800");
				}

				if(_translateFrom.End_LastPasswordFailureDate != null)
				{
					temp.End_LastPasswordFailureDate = _translateFrom.End_LastPasswordFailureDate;
				}
				else
				{
					temp.End_LastPasswordFailureDate = Convert.ToDateTime("01/01/2032");
				}
				if(_translateFrom.Beg_PasswordFailuresSinceLastSuccess != 0)
				{
					temp.Beg_PasswordFailuresSinceLastSuccess = _translateFrom.Beg_PasswordFailuresSinceLastSuccess;
				}
				else
					{
						temp.Beg_PasswordFailuresSinceLastSuccess = -999999;
					}

					if(_translateFrom.End_PasswordFailuresSinceLastSuccess != 0)
					{
						temp.End_PasswordFailuresSinceLastSuccess = _translateFrom.End_PasswordFailuresSinceLastSuccess;
					}
					else
					{
						temp.End_PasswordFailuresSinceLastSuccess = 999999;
					}
					temp.Password = _translateFrom.Password;
					if(_translateFrom.Beg_PasswordChangedDate != null)
					{
						temp.Beg_PasswordChangedDate = _translateFrom.Beg_PasswordChangedDate;
					}
					else
						{
							temp.Beg_PasswordChangedDate = Convert.ToDateTime("01/01/1800");
						}

						if(_translateFrom.End_PasswordChangedDate != null)
						{
							temp.End_PasswordChangedDate = _translateFrom.End_PasswordChangedDate;
						}
						else
						{
							temp.End_PasswordChangedDate = Convert.ToDateTime("01/01/2032");
						}
						temp.PasswordSalt = _translateFrom.PasswordSalt;
						temp.PasswordVerificationToken = _translateFrom.PasswordVerificationToken;
						if(_translateFrom.Beg_PasswordVerificationTokenExpirationDate != null)
						{
							temp.Beg_PasswordVerificationTokenExpirationDate = _translateFrom.Beg_PasswordVerificationTokenExpirationDate;
						}
						else
							{
								temp.Beg_PasswordVerificationTokenExpirationDate = Convert.ToDateTime("01/01/1800");
							}

							if(_translateFrom.End_PasswordVerificationTokenExpirationDate != null)
							{
								temp.End_PasswordVerificationTokenExpirationDate = _translateFrom.End_PasswordVerificationTokenExpirationDate;
							}
							else
							{
								temp.End_PasswordVerificationTokenExpirationDate = Convert.ToDateTime("01/01/2032");
							}
							temp.EmailAccount = _translateFrom.EmailAccount;
							temp.PasswordAnswer = _translateFrom.PasswordAnswer;
									
									
									}
									return temp;
									
								}
								
								
							
							}
						
						
						}
						
						
						 
						
							
							
